在Flash课件中实现多个对象的无序播放
在制作长度的测量仪器、静电应用、细胞分裂等课件时,想让使用者通过点击相关按钮播放。其实制作流程是这样的:以细胞分裂为例,先把基础知识、有丝分裂、减数分裂、受精作用制作成影片剪辑,再制作按钮,然后使用者通过点击相关按钮播放。其实做关键上是实现这几个对象的无序播放。下面介绍具体介绍一下:
1、在场景中,把四个数字按钮依次拖入到时间轴的第一层第一帧,并加入语句“stop();”。
2、新建四个图层,在新建图层的第二帧分别插入空白关键帧,然后把四个特点的影片剪辑分别拖入到四个新建图层的第二帧,并把对象的引用名称分别命名为“jczd”、“ysfl”、“jsfl”、“sjzy”。
3、在第一层第一帧的四个按钮上分别写入如下脚本内容:
(1) on(release){
gotoAndStop(2);
_root.td1.gotoAndPlay(2);
if (_root.td2._currentframe==1)
{_root.td2.gotoAndStop(1);}
else
{_root.td2.gotoAndStop(15);}
if (_root.td3._currentframe==1)
{_root.td3.gotoAndStop(1);}
else
{_root.td3.gotoAndStop(15);}
if (_root.td4._currentframe==1)
{_root.td4.gotoAndStop(1);}
else
{_root.td4.gotoAndStop(15);}
}
(2)on(release){
gotoAndStop(2);
_root.td2.gotoAndPlay(2);
if (_root.td3._currentframe==1)
{_root.td3.gotoAndStop(1);}
else
{_root.td3.gotoAndStop(15);}
if (_root.td1._currentframe==1)
{_root.td1.gotoAndStop(1);}
else
{_root.td1.gotoAndStop(15);}
if (_root.td4._currentframe==1)
{_root.td4.gotoAndStop(1);}
else
{_root.td4.gotoAndStop(15);}
}
(3)on(release){
gotoAndStop(2);
_root.td3.gotoAndPlay(2);
if (_root.td2._currentframe==1)
{_root.td2.gotoAndStop(1);}
else
{_root.td2.gotoAndStop(15);}
if (_root.td1._currentframe==1)
{_root.td1.gotoAndStop(1);}
else
{_root.td1.gotoAndStop(15);}
if (_root.td4._currentframe==1)
{_root.td4.gotoAndStop(1);}
else
{_root.td4.gotoAndStop(15);}
}
(4)on(release){
gotoAndStop(2);
_root.td4.gotoAndPlay(2);
if (_root.td2._currentframe==1)
{_root.td2.gotoAndStop(1);}
else
{_root.td2.gotoAndStop(15);}
if (_root.td1._currentframe==1)
{_root.td1.gotoAndStop(1);}
else
{_root.td1.gotoAndStop(15);}
if (_root.td3._currentframe==1)
{_root.td3.gotoAndStop(1);}
else
{_root.td3.gotoAndStop(15);}
}
完成以后,使用者在使用过程中就可以根据需要按任意顺序来呈现相应的内容了,也增强了课件的交互性,满足使用者的实际需要。
|